home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / Cpp4VB / WINTLB / NETWORK.ODL < prev    next >
Text File  |  1996-02-27  |  13KB  |  452 lines

  1.  
  2. [
  3. uuid(54674050-3A82-101B-8181-00AA003743D3),
  4. helpstring("Networks"),
  5. #if WIN32
  6. dllname("MPR.DLL")
  7. #else
  8. dllname("USER.EXE")
  9. #endif
  10. ]
  11. module Network {
  12.  
  13.     // ****** Network support *******
  14.  
  15.     [
  16.     #ifdef WIN32
  17.     usesgetlasterror,
  18.     entry("WNetAddConnectionA"),
  19.     #else
  20.     entry("WNetAddConnection"),
  21.     #endif
  22.     helpstring("Redirects a local device to a shared devices or remote server"),
  23.     ]
  24.     UINT WINAPI WNetAddConnection([in] LPSTR lpszNetPath,
  25.                                   [in] LPSTR lpszPassword,
  26.                                   [in] LPSTR lpszLocalName);
  27.  
  28.     [
  29.     #ifdef WIN32
  30.     usesgetlasterror,
  31.     entry("WNetGetUserA"),
  32.     #else
  33.     entry("WNetGetUser"),
  34.     #endif
  35.     helpstring("Gets the user name"),
  36.     ]
  37.     UINT WINAPI WNetGetUser([in, out] LPSTR lpszBuffer,
  38.                             [in] UINT FAR * cbBuffer);
  39.  
  40.     [
  41.     #ifdef WIN32
  42.     usesgetlasterror,
  43.     entry("WNetGetConnectionA"),
  44.     #else
  45.     entry("WNetGetConnection"),
  46.     #endif
  47.     helpstring("Gets the name of the shared devices associated with the given local device"),
  48.     ]
  49.     UINT WINAPI WNetGetConnection([in] LPSTR lpszLocalName,
  50.                                   [in, out] LPSTR lpszRemoteName,
  51.                                   [in, out] UINT FAR * cbRemoteName);
  52.  
  53.     [
  54.     #ifdef WIN32
  55.     usesgetlasterror,
  56.     entry("WNetCancelConnectionA"),
  57.     #else
  58.     entry("WNetCancelConnection"),
  59.     #endif
  60.     helpstring("Cancels a network connection device, forcing open connections to close if fForce is true"),
  61.     ]
  62.     UINT WINAPI WNetCancelConnection([in] LPSTR lpszName,
  63.                                      [in] BOOL fForce);
  64.  
  65.     [
  66.     usesgetlasterror,
  67.     entry("WNetConnectionDialog"),
  68.     helpstring("Starts a browsing dialog for connecting to network resources"),
  69.     ]
  70.     UINT WINAPI WNetConnectionDialog([in] UINT hWnd,
  71.                                      [in] UINT fdwResourceType);
  72.  
  73.  
  74.     [
  75.     usesgetlasterror,
  76.     entry("WNetDisconnectDialog"),
  77.     helpstring("Starts a browsing dialog for disconnecting a network resource"),
  78.     ]
  79.     DWORD WINAPI
  80.     WNetDisconnectDialog([in] HWND  hwnd, [in] DWORD dwType);
  81.  
  82.     const long RESOURCETYPE_ANY         = 0x00000000;
  83.     const long RESOURCETYPE_DISK        = 0x00000001;
  84.     const long RESOURCETYPE_PRINT       = 0x00000002;
  85.     const long RESOURCETYPE_UNKNOWN     = 0xFFFFFFFF;
  86.     // Win95 only
  87.     const long RESOURCETYPE_RESERVED    = 0x00000008;
  88.  
  89.     /*
  90.     const DWORD RESOURCE_CONNECTED     = 0x00000001;
  91.     const DWORD RESOURCE_GLOBALNET     = 0x00000002;
  92.     const DWORD RESOURCE_REMEMBERED    = 0x00000003;
  93.     //         #if(WINVER >= 0x0400)
  94.     const DWORD RESOURCE_RECENT        = 0x00000004;
  95.     const DWORD RESOURCE_CONTEXT       = 0x00000005;
  96.     //         #endif // WINVER >= 0x0400
  97.  
  98.     const DWORD RESOURCEUSAGE_CONNECTABLE  = 0x00000001;
  99.     const DWORD RESOURCEUSAGE_CONTAINER    = 0x00000002;
  100.     //         #if(WINVER >= 0x0400)
  101.     const DWORD RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004;
  102.     const DWORD RESOURCEUSAGE_SIBLING      = 0x00000008;
  103.     const DWORD RESOURCEUSAGE_ALL          = 0x00000003; // RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER
  104.     //         #endif // WINVER >= 0x0400
  105.     const DWORD RESOURCEUSAGE_RESERVED     = 0x80000000;
  106.  
  107.     const DWORD RESOURCEDISPLAYTYPE_GENERIC       = 0x00000000;
  108.     const DWORD RESOURCEDISPLAYTYPE_DOMAIN        = 0x00000001;
  109.     const DWORD RESOURCEDISPLAYTYPE_SERVER        = 0x00000002;
  110.     const DWORD RESOURCEDISPLAYTYPE_SHARE         = 0x00000003;
  111.     const DWORD RESOURCEDISPLAYTYPE_FILE          = 0x00000004;
  112.     const DWORD RESOURCEDISPLAYTYPE_GROUP         = 0x00000005;
  113.     //         #if(WINVER >= 0x0400)
  114.     const DWORD RESOURCEDISPLAYTYPE_NETWORK       = 0x00000006;
  115.     const DWORD RESOURCEDISPLAYTYPE_ROOT          = 0x00000007;
  116.     const DWORD RESOURCEDISPLAYTYPE_SHAREADMIN    = 0x00000008;
  117.     const DWORD RESOURCEDISPLAYTYPE_DIRECTORY     = 0x00000009;
  118.     //         #endif // WINVER >= 0x0400
  119.     const DWORD RESOURCEDISPLAYTYPE_TREE          = 0x0000000A;
  120.     */
  121.  
  122.     /*
  123.     typedef struct  _NETRESOURCEA {
  124.         DWORD    dwScope;
  125.         DWORD    dwType;
  126.         DWORD    dwDisplayType;
  127.         DWORD    dwUsage;
  128.         LPSTR    lpLocalName;
  129.         LPSTR    lpRemoteName;
  130.         LPSTR    lpComment ;
  131.         LPSTR    lpProvider;
  132.     }NETRESOURCEA, *LPNETRESOURCEA;
  133.     typedef NETRESOURCEA NETRESOURCE;
  134.     typedef LPNETRESOURCEA LPNETRESOURCE;
  135.     */
  136.  
  137.     //
  138.     //  Network Connections
  139.     //
  140.  
  141.     /*
  142.     const int NETPROPERTY_PERSISTENT      = 1;
  143.  
  144.     const DWORD CONNECT_UPDATE_PROFILE     = 0x00000001;
  145.     const DWORD CONNECT_UPDATE_RECENT      = 0x00000002;
  146.     const DWORD CONNECT_TEMPORARY          = 0x00000004;
  147.     const DWORD CONNECT_INTERACTIVE        = 0x00000008;
  148.     const DWORD CONNECT_PROMPT             = 0x00000010;
  149.     const DWORD CONNECT_NEED_DRIVE         = 0x00000020;
  150.     //         #if(WINVER >= 0x0400)
  151.     const DWORD CONNECT_REFCOUNT           = 0x00000040;
  152.     const DWORD CONNECT_REDIRECT           = 0x00000080;
  153.     const DWORD CONNECT_LOCALDRIVE         = 0x00000100;
  154.     const DWORD CONNECT_CURRENT_MEDIA      = 0x00000200;
  155.     //         #endif // WINVER >= 0x0400
  156.     */
  157.  
  158.     /*
  159.     DWORD WINAPI
  160.     WNetAddConnection2A(
  161.          LPNETRESOURCEA lpNetResource,
  162.          LPCSTR       lpPassword,
  163.          LPCSTR       lpUserName,
  164.          DWORD          dwFlags
  165.         );
  166.  
  167.     DWORD WINAPI
  168.     WNetAddConnection3A(
  169.          HWND           hwndOwner,
  170.          LPNETRESOURCEA lpNetResource,
  171.          LPCSTR       lpPassword,
  172.          LPCSTR       lpUserName,
  173.          DWORD          dwFlags
  174.         );
  175.  
  176.     DWORD WINAPI
  177.     WNetCancelConnection2A(
  178.          LPCSTR lpName,
  179.          DWORD    dwFlags,
  180.          BOOL     fForce
  181.         );
  182.  
  183.     //         #if(WINVER >= 0x0400)
  184.     DWORD WINAPI
  185.     WNetUseConnectionA(
  186.         HWND            hwndOwner,
  187.         LPNETRESOURCEA  lpNetResource,
  188.         LPCSTR        lpUserID,
  189.         LPCSTR        lpPassword,
  190.         DWORD           dwFlags,
  191.         LPSTR         lpAccessName,
  192.         LPDWORD         lpBufferSize,
  193.         LPDWORD         lpResult
  194.         );
  195.  
  196.     DWORD WINAPI
  197.     WNetSetConnectionA(
  198.         LPCSTR    lpName,
  199.         DWORD       dwProperties,
  200.         LPVOID      pvValues
  201.         );
  202.     */
  203.     //         #endif /* WINVER >= 0x0400 */
  204.  
  205.     //
  206.     //  Network Connection Dialogs.
  207.     //
  208.  
  209.     //         #if(WINVER >= 0x0400)
  210.     /*
  211.     typedef struct _CONNECTDLGSTRUCTA{
  212.         DWORD cbStructure;       // size of this structure in bytes
  213.         HWND hwndOwner;          // owner window for the dialog
  214.         LPNETRESOURCEA lpConnRes;// Requested Resource info
  215.         DWORD dwFlags;           // flags (see below)
  216.         DWORD dwDevNum;          // number of devices connected to
  217.     } CONNECTDLGSTRUCTA, FAR *LPCONNECTDLGSTRUCTA;
  218.  
  219.     const DWORD CONNDLG_RO_PATH    = 0x00000001; // Resource path should be read-only
  220.     const DWORD CONNDLG_CONN_POINT = 0x00000002; // Netware -style movable connection point enabled
  221.     const DWORD CONNDLG_USE_MRU    = 0x00000004; // Use MRU combobox
  222.     const DWORD CONNDLG_HIDE_BOX   = 0x00000008; // Hide persistent connect checkbox
  223.     */
  224.  
  225.     /*
  226.      * NOTE:  Set at most ONE of the below flags. If neither flag is set,
  227.      *        then the persistence is set to whatever the user chose during
  228.      *        a previous connection
  229.     const DWORD CONNDLG_PERSIST    = 0x00000010;  // Force persistent connection
  230.     const DWORD CONNDLG_NOT_PERSIST = 0x00000020; // Force connection NOT persistent
  231.      */
  232.  
  233.     /*
  234.     DWORD WINAPI
  235.     WNetConnectionDialog1A(
  236.         LPCONNECTDLGSTRUCTA lpConnDlgStruct
  237.         );
  238.     */
  239.  
  240.     /*
  241.     typedef struct _DISCDLGSTRUCTA{
  242.         DWORD           cbStructure;      // size of this structure in bytes
  243.         HWND            hwndOwner;        // owner window for the dialog
  244.         LPSTR           lpLocalName;      // local device name
  245.         LPSTR           lpRemoteName;     // network resource name
  246.         DWORD           dwFlags;          // flags
  247.     } DISCDLGSTRUCTA, FAR *LPDISCDLGSTRUCTA;
  248.  
  249.     const DWORD DISC_UPDATE_PROFILE        = 0x00000001;
  250.     const DWORD DISC_NO_FORCE              = 0x00000040;
  251.     */
  252.  
  253.     /*
  254.     DWORD WINAPI
  255.     WNetDisconnectDialog1A(
  256.         LPDISCDLGSTRUCTA lpConnDlgStruct
  257.         );
  258.     */
  259.     //         #endif // WINVER >= 0x0400
  260.  
  261.     //
  262.     //  Network Browsing.
  263.     //
  264.  
  265.     /*
  266.     DWORD WINAPI
  267.     WNetOpenEnumA(
  268.          DWORD          dwScope,
  269.          DWORD          dwType,
  270.          DWORD          dwUsage,
  271.          LPNETRESOURCEA lpNetResource,
  272.          LPHANDLE       lphEnum
  273.         );
  274.  
  275.     DWORD WINAPI
  276.     WNetEnumResourceA(
  277.          HANDLE  hEnum,
  278.          LPDWORD lpcCount,
  279.          LPVOID  lpBuffer,
  280.          LPDWORD lpBufferSize
  281.         );
  282.  
  283.     DWORD WINAPI
  284.     WNetCloseEnum(
  285.         HANDLE   hEnum
  286.         );
  287.     */
  288.  
  289.     //
  290.     //  Universal Naming.
  291.     //
  292.  
  293.     /*
  294.     const DWORD UNIVERSAL_NAME_INFO_LEVEL  = 0x00000001;
  295.     const DWORD REMOTE_NAME_INFO_LEVEL     = 0x00000002;
  296.  
  297.     typedef struct  _UNIVERSAL_NAME_INFOA {
  298.         LPSTR    lpUniversalName;
  299.     }UNIVERSAL_NAME_INFOA, *LPUNIVERSAL_NAME_INFOA;
  300.  
  301.     typedef struct  _REMOTE_NAME_INFOA {
  302.         LPSTR    lpUniversalName;
  303.         LPSTR    lpConnectionName;
  304.         LPSTR    lpRemainingPath;
  305.     }REMOTE_NAME_INFOA, *LPREMOTE_NAME_INFOA;
  306.     */
  307.  
  308.     /*
  309.     DWORD WINAPI
  310.     WNetGetUniversalNameA(
  311.          LPCSTR lpLocalPath,
  312.          DWORD    dwInfoLevel,
  313.          LPVOID   lpBuffer,
  314.          LPDWORD  lpBufferSize
  315.          );
  316.     */
  317.  
  318.     //
  319.     // Other.
  320.     //
  321.  
  322.     /*
  323.     //         #if(WINVER >= 0x0400)
  324.     const WORD WNFMT_MULTILINE        = 0x01;
  325.     const WORD WNFMT_ABBREVIATED      = 0x02;
  326.     const WORD WNFMT_INENUM           = 0x10;
  327.     const WORD WNFMT_CONNECTION       = 0x20;
  328.     //         #endif // WINVER >= 0x0400
  329.     */
  330.  
  331.     //         #if(WINVER >= 0x0400)
  332.     /*
  333.     DWORD WINAPI
  334.     WNetGetProviderNameA(
  335.         DWORD   dwNetType,
  336.         LPSTR lpProviderName,
  337.         LPDWORD lpBufferSize
  338.         );
  339.     */
  340.  
  341.     /*
  342.     typedef struct _NETINFOSTRUCT{
  343.         DWORD cbStructure;
  344.         DWORD dwProviderVersion;
  345.         DWORD dwStatus;
  346.         DWORD dwCharacteristics;
  347.         DWORD dwHandle;
  348.         WORD  wNetType;
  349.         DWORD dwPrinters;
  350.         DWORD dwDrives;
  351.     } NETINFOSTRUCT, FAR *LPNETINFOSTRUCT;
  352.  
  353.     const DWORD NETINFO_DLL16      = 0x00000001;  // Provider running as 16 bit Winnet Driver
  354.     const DWORD NETINFO_DISKRED    = 0x00000004;  // Provider requires disk redirections to connect
  355.     const DWORD NETINFO_PRINTERRED = 0x00000008;  // Provider requires printer redirections to connect
  356.     */
  357.  
  358.     /*
  359.     DWORD WINAPI
  360.     WNetGetNetworkInformationA(
  361.         LPCSTR          lpProvider,
  362.         LPNETINFOSTRUCT   lpNetInfoStruct
  363.         );
  364.     */
  365.  
  366.     //
  367.     //  User Profiles.
  368.     //
  369.  
  370.     /*
  371.     typedef UINT (FAR PASCAL *PFNGETPROFILEPATHA) (
  372.         LPCSTR    pszUsername,
  373.         LPSTR     pszBuffer,
  374.         UINT        cbBuffer
  375.         );
  376.  
  377.     typedef UINT (FAR PASCAL *PFNRECONCILEPROFILEA) (
  378.         LPCSTR    pszCentralFile,
  379.         LPCSTR    pszLocalFile,
  380.         DWORD       dwFlags
  381.         );
  382.  
  383.     const WORD RP_LOGON   = 0x01;  // if set, do for logon, else for logoff
  384.     const WORD RP_INIFILE = 0x02;  // if set, reconcile .INI file, else reg. hive
  385.     */
  386.  
  387.  
  388.     //
  389.     //  Policies.
  390.     //
  391.  
  392.     /*
  393.     typedef BOOL (FAR PASCAL *PFNPROCESSPOLICIESA) (
  394.         HWND        hwnd,
  395.         LPCSTR    pszPath,
  396.         LPCSTR    pszUsername,
  397.         LPCSTR    pszComputerName,
  398.         DWORD       dwFlags
  399.         );
  400.  
  401.     const WORD PP_DISPLAYERRORS   = 0x01;    // if set, display error messages, else fail silently if error
  402.     //         #endif // WINVER >= 0x0400
  403.     */
  404.  
  405.  
  406.     //
  407.     //  Error handling.
  408.     //
  409.  
  410.     /*
  411.     DWORD WINAPI
  412.     WNetGetLastErrorA(
  413.          LPDWORD    lpError,
  414.          LPSTR    lpErrorBuf,
  415.          DWORD      nErrorBufSize,
  416.          LPSTR    lpNameBuf,
  417.          DWORD      nNameBufSize
  418.         );
  419.     */
  420.  
  421.     //
  422.     //  For Shell
  423.     //
  424.  
  425.     //         #if(WINVER >= 0x0400)
  426.     /*
  427.     typedef struct _NETCONNECTINFOSTRUCT{
  428.         DWORD cbStructure;
  429.         DWORD dwFlags;
  430.         DWORD dwSpeed;
  431.         DWORD dwDelay;
  432.         DWORD dwOptDataSize;
  433.     } NETCONNECTINFOSTRUCT,  *LPNETCONNECTINFOSTRUCT;
  434.  
  435.     const DWORD WNCON_FORNETCARD       = 0x00000001;
  436.     const DWORD WNCON_NOTROUTED        = 0x00000002;
  437.     const DWORD WNCON_SLOWLINK         = 0x00000004;
  438.     const DWORD WNCON_DYNAMIC          = 0x00000008;
  439.     */
  440.  
  441.     /*
  442.     DWORD WINAPI
  443.     MultinetGetConnectionPerformanceA(
  444.             LPNETRESOURCEA lpNetResource,
  445.             LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct
  446.             );
  447.     */
  448.  
  449.     //         #endif // WINVER >= 0x0400
  450.  
  451. }
  452.